package chapter02.s03operator;

public class ConditionalOperator {
    public static void main(String[] args) {
        // 条件运算符
        // (expression) ? value if true : value if false
        int a, b;
        a = 10;

        b = (a == 10) ? 20 : 30;
        System.out.println("Value of b is : " + b);

        b = (a == 5) ? 20 : 30;
        System.out.println("Value of b is : " + b);
    }
}
